<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QHeaderView Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QHeaderView Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QHeaderView class provides a header row or header column for
item views. <a href="#details">More...</a></p>

<p>Inherits <a href="qabstractitemview.html">QAbstractItemView</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qheaderview.html#ResizeMode-enum">ResizeMode</a></b> { Interactive, Fixed, Stretch, ResizeToContents, Custom }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qheaderview.html#QHeaderView">__init__</a></b> (<i>self</i>, Qt.Orientation&#160;<i>orientation</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qheaderview.html#cascadingSectionResizes">cascadingSectionResizes</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#currentChanged">currentChanged</a></b> (<i>self</i>, QModelIndex&#160;<i>current</i>, QModelIndex&#160;<i>old</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#dataChanged">dataChanged</a></b> (<i>self</i>, QModelIndex&#160;<i>topLeft</i>, QModelIndex&#160;<i>bottomRight</i>)</li><li><div class="fn" />Qt.Alignment <b><a href="qheaderview.html#defaultAlignment">defaultAlignment</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#defaultSectionSize">defaultSectionSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#headerDataChanged">headerDataChanged</a></b> (<i>self</i>, Qt.Orientation&#160;<i>orientation</i>, int&#160;<i>logicalFirst</i>, int&#160;<i>logicalLast</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#hiddenSectionCount">hiddenSectionCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#hideSection">hideSection</a></b> (<i>self</i>, int&#160;<i>alogicalIndex</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#highlightSections">highlightSections</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#horizontalOffset">horizontalOffset</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qheaderview.html#indexAt">indexAt</a></b> (<i>self</i>, QPoint&#160;<i>p</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#initialize">initialize</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#initializeSections">initializeSections</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#initializeSections-2">initializeSections</a></b> (<i>self</i>, int&#160;<i>start</i>, int&#160;<i>end</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#initStyleOption">initStyleOption</a></b> (<i>self</i>, QStyleOptionHeader&#160;<i>option</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#isClickable">isClickable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#isIndexHidden">isIndexHidden</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#isMovable">isMovable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#isSectionHidden">isSectionHidden</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#isSortIndicatorShown">isSortIndicatorShown</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#length">length</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#logicalIndex">logicalIndex</a></b> (<i>self</i>, int&#160;<i>visualIndex</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#logicalIndexAt">logicalIndexAt</a></b> (<i>self</i>, int&#160;<i>position</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#logicalIndexAt-2">logicalIndexAt</a></b> (<i>self</i>, int&#160;<i>ax</i>, int&#160;<i>ay</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#logicalIndexAt-3">logicalIndexAt</a></b> (<i>self</i>, QPoint&#160;<i>apos</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#minimumSectionSize">minimumSectionSize</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" />QModelIndex <b><a href="qheaderview.html#moveCursor">moveCursor</a></b> (<i>self</i>, QAbstractItemView.CursorAction, Qt.KeyboardModifiers)</li><li><div class="fn" /><b><a href="qheaderview.html#moveSection">moveSection</a></b> (<i>self</i>, int&#160;<i>from</i>, int&#160;<i>to</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#offset">offset</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Orientation <b><a href="qheaderview.html#orientation">orientation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#paintSection">paintSection</a></b> (<i>self</i>, QPainter&#160;<i>painter</i>, QRect&#160;<i>rect</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" />ResizeMode <b><a href="qheaderview.html#resizeMode">resizeMode</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#resizeSection">resizeSection</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#resizeSections">resizeSections</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#resizeSections-2">resizeSections</a></b> (<i>self</i>, ResizeMode&#160;<i>mode</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#restoreState">restoreState</a></b> (<i>self</i>, QByteArray&#160;<i>state</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#rowsInserted">rowsInserted</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>start</i>, int&#160;<i>end</i>)</li><li><div class="fn" />QByteArray <b><a href="qheaderview.html#saveState">saveState</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#scrollContentsBy">scrollContentsBy</a></b> (<i>self</i>, int&#160;<i>dx</i>, int&#160;<i>dy</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#scrollTo">scrollTo</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, QAbstractItemView.ScrollHint&#160;<i>hint</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#sectionPosition">sectionPosition</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#sectionsAboutToBeRemoved">sectionsAboutToBeRemoved</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>logicalFirst</i>, int&#160;<i>logicalLast</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#sectionsHidden">sectionsHidden</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#sectionsInserted">sectionsInserted</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>logicalFirst</i>, int&#160;<i>logicalLast</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#sectionSize">sectionSize</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" />QSize <b><a href="qheaderview.html#sectionSizeFromContents">sectionSizeFromContents</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#sectionSizeHint">sectionSizeHint</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#sectionsMoved">sectionsMoved</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#sectionViewportPosition">sectionViewportPosition</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setCascadingSectionResizes">setCascadingSectionResizes</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setClickable">setClickable</a></b> (<i>self</i>, bool&#160;<i>clickable</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setDefaultAlignment">setDefaultAlignment</a></b> (<i>self</i>, Qt.Alignment&#160;<i>alignment</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setDefaultSectionSize">setDefaultSectionSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setHighlightSections">setHighlightSections</a></b> (<i>self</i>, bool&#160;<i>highlight</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setMinimumSectionSize">setMinimumSectionSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setModel">setModel</a></b> (<i>self</i>, QAbstractItemModel&#160;<i>model</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setMovable">setMovable</a></b> (<i>self</i>, bool&#160;<i>movable</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setOffset">setOffset</a></b> (<i>self</i>, int&#160;<i>offset</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setOffsetToLastSection">setOffsetToLastSection</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setOffsetToSectionPosition">setOffsetToSectionPosition</a></b> (<i>self</i>, int&#160;<i>visualIndex</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setResizeMode">setResizeMode</a></b> (<i>self</i>, ResizeMode&#160;<i>mode</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setResizeMode-2">setResizeMode</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>, ResizeMode&#160;<i>mode</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setSectionHidden">setSectionHidden</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>, bool&#160;<i>hide</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setSelection">setSelection</a></b> (<i>self</i>, QRect, QItemSelectionModel.SelectionFlags)</li><li><div class="fn" /><b><a href="qheaderview.html#setSortIndicator">setSortIndicator</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>, Qt.SortOrder&#160;<i>order</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setSortIndicatorShown">setSortIndicatorShown</a></b> (<i>self</i>, bool&#160;<i>show</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#setStretchLastSection">setStretchLastSection</a></b> (<i>self</i>, bool&#160;<i>stretch</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#showSection">showSection</a></b> (<i>self</i>, int&#160;<i>alogicalIndex</i>)</li><li><div class="fn" />QSize <b><a href="qheaderview.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.SortOrder <b><a href="qheaderview.html#sortIndicatorOrder">sortIndicatorOrder</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#sortIndicatorSection">sortIndicatorSection</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#stretchLastSection">stretchLastSection</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#stretchSectionCount">stretchSectionCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#swapSections">swapSections</a></b> (<i>self</i>, int&#160;<i>first</i>, int&#160;<i>second</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#updateGeometries">updateGeometries</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qheaderview.html#updateSection">updateSection</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#verticalOffset">verticalOffset</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qheaderview.html#viewportEvent">viewportEvent</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#visualIndex">visualIndex</a></b> (<i>self</i>, int&#160;<i>logicalIndex</i>)</li><li><div class="fn" />int <b><a href="qheaderview.html#visualIndexAt">visualIndexAt</a></b> (<i>self</i>, int&#160;<i>position</i>)</li><li><div class="fn" />QRect <b><a href="qheaderview.html#visualRect">visualRect</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QRegion <b><a href="qheaderview.html#visualRegionForSelection">visualRegionForSelection</a></b> (<i>self</i>, QItemSelection&#160;<i>selection</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" /> <b><a href="qheaderview.html#__len__">__len__</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qheaderview.html#geometriesChanged">geometriesChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionAutoResize">sectionAutoResize</a></b> (int,QHeaderView::ResizeMode)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionClicked">sectionClicked</a></b> (int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionCountChanged">sectionCountChanged</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionDoubleClicked">sectionDoubleClicked</a></b> (int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionEntered">sectionEntered</a></b> (int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionHandleDoubleClicked">sectionHandleDoubleClicked</a></b> (int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionMoved">sectionMoved</a></b> (int,int,int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionPressed">sectionPressed</a></b> (int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sectionResized">sectionResized</a></b> (int,int,int)</li><li><div class="fn" />void <b><a href="qheaderview.html#sortIndicatorChanged">sortIndicatorChanged</a></b> (int,Qt::SortOrder)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QHeaderView class provides a header row or header column for
item views.</p>
<p>A QHeaderView displays the headers used in item views such as
the <a href="qtableview.html">QTableView</a> and <a href="qtreeview.html">QTreeView</a> classes. It takes the place of Qt3's
<tt>QHeader</tt> class previously used for the same purpose, but
uses the Qt's model/view architecture for consistency with the item
view classes.</p>
<p>The QHeaderView class is one of the <a href="model-view.html">Model/View Classes</a> and is part of Qt's
<a href="model-view-programming.html">model/view framework</a>.</p>
<p>The header gets the data for each section from the model using
the <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>()
function. You can set the data by using <a href="qabstractitemmodel.html#setHeaderData">QAbstractItemModel.setHeaderData</a>().</p>
<p>Each header has an <a href="qheaderview.html#orientation">orientation</a>() and a number of
sections, given by the <a href="qheaderview.html#count">count</a>()
function. A section refers to a part of the header - either a row
or a column, depending on the orientation.</p>
<p>Sections can be moved and resized using <a href="qheaderview.html#moveSection">moveSection</a>() and <a href="qheaderview.html#resizeSection">resizeSection</a>(); they can also
be hidden and shown with <a href="qheaderview.html#hideSection">hideSection</a>() and <a href="qheaderview.html#showSection">showSection</a>().</p>
<p>Each section of a header is described by a section ID, specified
by its section(), and can be located at a particular <a href="qheaderview.html#visualIndex">visualIndex</a>() in the header. A
section can have a sort indicator set with <a href="qheaderview.html#setSortIndicator">setSortIndicator</a>(); this
indicates whether the items in the associated item view will be
sorted in the order given by the section.</p>
<p>For a horizontal header the section is equivalent to a column in
the model, and for a vertical header the section is equivalent to a
row in the model.</p>
<a id="moving-header-sections" name="moving-header-sections" />
<h3>Moving Header Sections</h3>
<p>A header can be fixed in place, or made movable with <a href="qheaderview.html#setMovable">setMovable</a>(). It can be made
clickable with <a href="qheaderview.html#setClickable">setClickable</a>(), and has
resizing behavior in accordance with <a href="qheaderview.html#setResizeMode">setResizeMode</a>().</p>
<p><b>Note:</b> Double-clicking on a header to resize a section
only applies for visible rows.</p>
<p>A header will emit <a href="qheaderview.html#sectionMoved">sectionMoved</a>() if the user
moves a section, <a href="qheaderview.html#sectionResized">sectionResized</a>() if the user
resizes a section, and <a href="qheaderview.html#sectionClicked">sectionClicked</a>() as well as
<a href="qheaderview.html#sectionHandleDoubleClicked">sectionHandleDoubleClicked</a>()
in response to mouse clicks. A header will also emit <a href="qheaderview.html#sectionCountChanged">sectionCountChanged</a>()
and <a href="qheaderview.html#sectionAutoResize">sectionAutoResize</a>().</p>
<p>You can identify a section using the <a href="qheaderview.html#logicalIndex">logicalIndex</a>() and <a href="qheaderview.html#logicalIndexAt">logicalIndexAt</a>() functions,
or by its index position, using the <a href="qheaderview.html#visualIndex">visualIndex</a>() and <a href="qheaderview.html#visualIndexAt">visualIndexAt</a>() functions. The
visual index will change if a section is moved, but the logical
index will not change.</p>
<a id="appearance" name="appearance" />
<h3>Appearance</h3>
<p><a href="qtablewidget.html">QTableWidget</a> and <a href="qtableview.html">QTableView</a> create default headers. If you
want the headers to be visible, you can use <a href="qwidget.html#visible-prop">setVisible()</a>.</p>
<p>Not all <a href="qt.html#ItemDataRole-enum">ItemDataRole</a>s
will have an effect on a QHeaderView. If you need to draw other
roles, you can subclass QHeaderView and reimplement <a href="qheaderview.html#paintEvent">paintEvent()</a>. QHeaderView
respects the following item data roles: <a href="qt.html#ItemDataRole-enum">TextAlignmentRole</a>, <a href="qt.html#ItemDataRole-enum">DisplayRole</a>, <a href="qt.html#ItemDataRole-enum">FontRole</a>, <a href="qt.html#ItemDataRole-enum">DecorationRole</a>, <a href="qt.html#ItemDataRole-enum">ForegroundRole</a>, and <a href="qt.html#ItemDataRole-enum">BackgroundRole</a>.</p>
<p><b>Note:</b> Each header renders the data for each section
itself, and does not rely on a delegate. As a result, calling a
header's <a href="qabstractitemview.html#setItemDelegate">setItemDelegate</a>()
function will have no effect.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ResizeMode-enum" />QHeaderView.ResizeMode</h3><p>The resize mode specifies the behavior of the header sections.
It can be set on the entire header view or on individual sections
using <a href="qheaderview.html#setResizeMode">setResizeMode</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QHeaderView.Interactive</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The user can resize the section. The section
can also be resized programmatically using <a href="qheaderview.html#resizeSection">resizeSection</a>(). The section
size defaults to <a href="qheaderview.html#defaultSectionSize-prop">defaultSectionSize</a>.
(See also <a href="qheaderview.html#cascadingSectionResizes-prop">cascadingSectionResizes</a>.)</td>
</tr>
<tr>
<td class="topAlign"><tt>QHeaderView.Fixed</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The user cannot resize the section. The
section can only be resized programmatically using <a href="qheaderview.html#resizeSection">resizeSection</a>(). The section
size defaults to <a href="qheaderview.html#defaultSectionSize-prop">defaultSectionSize</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QHeaderView.Stretch</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign"><a href="qheaderview.html">QHeaderView</a>
will automatically resize the section to fill the available space.
The size cannot be changed by the user or programmatically.</td>
</tr>
<tr>
<td class="topAlign"><tt>QHeaderView.ResizeToContents</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign"><a href="qheaderview.html">QHeaderView</a>
will automatically resize the section to its optimal size based on
the contents of the entire column or row. The size cannot be
changed by the user or programmatically. (This value was introduced
in 4.2)</td>
</tr>
</table>
<p>The following values are obsolete:</p>
<table class="valuelist">
<tr class="even" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QHeaderView.Custom</tt></td>
<td class="topAlign"><tt>Fixed</tt></td>
<td class="topAlign">Use Fixed instead.</td>
</tr>
</table>
<p><b>See also</b> <a href="qheaderview.html#setResizeMode">setResizeMode</a>(), <a href="qheaderview.html#stretchLastSection-prop">stretchLastSection</a>,
and <a href="qheaderview.html#minimumSectionSize-prop">minimumSectionSize</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QHeaderView" />QHeaderView.__init__ (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates a new generic header with the given <i>orientation</i>
and <i>parent</i>.</p>


<h3 class="fn"><a name="cascadingSectionResizes" />bool QHeaderView.cascadingSectionResizes (<i>self</i>)</h3><h3 class="fn"><a name="count" />int QHeaderView.count (<i>self</i>)</h3><p>Returns the number of sections in the header.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionCountChanged">sectionCountChanged</a>()
and <a href="qheaderview.html#length">length</a>().</p>


<h3 class="fn"><a name="currentChanged" />QHeaderView.currentChanged (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>current</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>old</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#currentChanged">QAbstractItemView.currentChanged</a>().</p>


<h3 class="fn"><a name="dataChanged" />QHeaderView.dataChanged (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>topLeft</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>bottomRight</i>)</h3><h3 class="fn"><a name="defaultAlignment" /><a href="qt-alignment.html">Qt.Alignment</a> QHeaderView.defaultAlignment (<i>self</i>)</h3><h3 class="fn"><a name="defaultSectionSize" />int QHeaderView.defaultSectionSize (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QHeaderView.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="headerDataChanged" />QHeaderView.headerDataChanged (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, int&#160;<i>logicalFirst</i>, int&#160;<i>logicalLast</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void headerDataChanged(Qt::Orientation,int,int)</tt>.</p><p>Updates the changed header sections with the given
<i>orientation</i>, from <i>logicalFirst</i> to <i>logicalLast</i>
inclusive.</p>


<h3 class="fn"><a name="hiddenSectionCount" />int QHeaderView.hiddenSectionCount (<i>self</i>)</h3><p>Returns the number of sections in the header that has been
hidden.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qheaderview.html#setSectionHidden">setSectionHidden</a>() and
<a href="qheaderview.html#isSectionHidden">isSectionHidden</a>().</p>


<h3 class="fn"><a name="hideSection" />QHeaderView.hideSection (<i>self</i>, int&#160;<i>alogicalIndex</i>)</h3><p>Hides the section specified by <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#showSection">showSection</a>(), <a href="qheaderview.html#isSectionHidden">isSectionHidden</a>(), <a href="qheaderview.html#hiddenSectionCount">hiddenSectionCount</a>(), and
<a href="qheaderview.html#setSectionHidden">setSectionHidden</a>().</p>


<h3 class="fn"><a name="highlightSections" />bool QHeaderView.highlightSections (<i>self</i>)</h3><h3 class="fn"><a name="horizontalOffset" />int QHeaderView.horizontalOffset (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#horizontalOffset">QAbstractItemView.horizontalOffset</a>().</p>
<p>Returns the horizontal offset of the header. This is 0 for
vertical headers.</p>
<p><b>See also</b> <a href="qheaderview.html#offset">offset</a>().</p>


<h3 class="fn"><a name="indexAt" /><a href="qmodelindex.html">QModelIndex</a> QHeaderView.indexAt (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>p</i>)</h3><h3 class="fn"><a name="initialize" />QHeaderView.initialize (<i>self</i>)</h3><h3 class="fn"><a name="initializeSections" />QHeaderView.initializeSections (<i>self</i>)</h3><h3 class="fn"><a name="initializeSections-2" />QHeaderView.initializeSections (<i>self</i>, int&#160;<i>start</i>, int&#160;<i>end</i>)</h3><h3 class="fn"><a name="initStyleOption" />QHeaderView.initStyleOption (<i>self</i>, <a href="qstyleoptionheader.html">QStyleOptionHeader</a>&#160;<i>option</i>)</h3><p>Initialize <i>option</i> with the values from this <a href="qheaderview.html">QHeaderView</a>. This method is useful for
subclasses when they need a <a href="qstyleoptionheader.html">QStyleOptionHeader</a>, but do not want
to fill in all the information themselves.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">QStyleOption.initFrom</a>().</p>


<h3 class="fn"><a name="isClickable" />bool QHeaderView.isClickable (<i>self</i>)</h3><p>Returns true if the header is clickable; otherwise returns
false. A clickable header could be set up to allow the user to
change the representation of the data in the view related to the
header.</p>
<p><b>See also</b> <a href="qheaderview.html#setClickable">setClickable</a>().</p>


<h3 class="fn"><a name="isIndexHidden" />bool QHeaderView.isIndexHidden (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><h3 class="fn"><a name="isMovable" />bool QHeaderView.isMovable (<i>self</i>)</h3><p>Returns true if the header can be moved by the user; otherwise
returns false.</p>
<p><b>See also</b> <a href="qheaderview.html#setMovable">setMovable</a>().</p>


<h3 class="fn"><a name="isSectionHidden" />bool QHeaderView.isSectionHidden (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns true if the section specified by <i>logicalIndex</i> is
explicitly hidden from the user; otherwise returns false.</p>
<p><b>See also</b> <a href="qheaderview.html#hideSection">hideSection</a>(), <a href="qheaderview.html#showSection">showSection</a>(), <a href="qheaderview.html#setSectionHidden">setSectionHidden</a>(), and
<a href="qheaderview.html#hiddenSectionCount">hiddenSectionCount</a>().</p>


<h3 class="fn"><a name="isSortIndicatorShown" />bool QHeaderView.isSortIndicatorShown (<i>self</i>)</h3><h3 class="fn"><a name="length" />int QHeaderView.length (<i>self</i>)</h3><p>Returns the length along the orientation of the header.</p>
<p><b>See also</b> <a href="qheaderview.html#sizeHint">sizeHint</a>(), <a href="qheaderview.html#setResizeMode">setResizeMode</a>(), and <a href="qheaderview.html#offset">offset</a>().</p>


<h3 class="fn"><a name="logicalIndex" />int QHeaderView.logicalIndex (<i>self</i>, int&#160;<i>visualIndex</i>)</h3><p>Returns the logicalIndex for the section at the given
<i>visualIndex</i> position, or -1 if visualIndex &lt; 0 or
visualIndex &gt;= <a href="qheaderview.html#count">QHeaderView.count</a>().</p>
<p>Note that the visualIndex is not affected by hidden
sections.</p>
<p><b>See also</b> <a href="qheaderview.html#visualIndex">visualIndex</a>() and <a href="qheaderview.html#sectionPosition">sectionPosition</a>().</p>


<h3 class="fn"><a name="logicalIndexAt" />int QHeaderView.logicalIndexAt (<i>self</i>, int&#160;<i>position</i>)</h3><p>Returns the section that covers the given <i>position</i> in the
viewport.</p>
<p><b>See also</b> <a href="qheaderview.html#visualIndexAt">visualIndexAt</a>() and <a href="qheaderview.html#isSectionHidden">isSectionHidden</a>().</p>


<h3 class="fn"><a name="logicalIndexAt-2" />int QHeaderView.logicalIndexAt (<i>self</i>, int&#160;<i>ax</i>, int&#160;<i>ay</i>)</h3><p>Returns the logical index of the section at the given
coordinate. If the header is horizontal <i>x</i> will be used,
otherwise <i>y</i> will be used to find the logical index.</p>


<h3 class="fn"><a name="logicalIndexAt-3" />int QHeaderView.logicalIndexAt (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>apos</i>)</h3><p>Returns the logical index of the section at the position given
in <i>pos</i>. If the header is horizontal the x-coordinate will be
used, otherwise the y-coordinate will be used to find the logical
index.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionPosition">sectionPosition</a>().</p>


<h3 class="fn"><a name="minimumSectionSize" />int QHeaderView.minimumSectionSize (<i>self</i>)</h3><h3 class="fn"><a name="mouseDoubleClickEvent" />QHeaderView.mouseDoubleClickEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget.mouseDoubleClickEvent</a>().</p>


<h3 class="fn"><a name="mouseMoveEvent" />QHeaderView.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>


<h3 class="fn"><a name="mousePressEvent" />QHeaderView.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>


<h3 class="fn"><a name="mouseReleaseEvent" />QHeaderView.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>


<h3 class="fn"><a name="moveCursor" /><a href="qmodelindex.html">QModelIndex</a> QHeaderView.moveCursor (<i>self</i>, <a href="qabstractitemview.html#CursorAction-enum">QAbstractItemView.CursorAction</a>, <a href="qt-keyboardmodifiers.html">Qt.KeyboardModifiers</a>)</h3><h3 class="fn"><a name="moveSection" />QHeaderView.moveSection (<i>self</i>, int&#160;<i>from</i>, int&#160;<i>to</i>)</h3><p>Moves the section at visual index <i>from</i> to occupy visual
index <i>to</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionsMoved">sectionsMoved</a>().</p>


<h3 class="fn"><a name="offset" />int QHeaderView.offset (<i>self</i>)</h3><p>Returns the offset of the header: this is the header's left-most
(or top-most for vertical headers) visible pixel.</p>
<p><b>See also</b> <a href="qheaderview.html#setOffset">setOffset</a>().</p>


<h3 class="fn"><a name="orientation" /><a href="qt.html#Orientation-enum">Qt.Orientation</a> QHeaderView.orientation (<i>self</i>)</h3><p>Returns the orientation of the header.</p>
<p><b>See also</b> <a href="qt.html#Orientation-enum">Qt.Orientation</a>.</p>


<h3 class="fn"><a name="paintEvent" />QHeaderView.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>


<h3 class="fn"><a name="paintSection" />QHeaderView.paintSection (<i>self</i>, <a href="qpainter.html">QPainter</a>&#160;<i>painter</i>, <a href="qrect.html">QRect</a>&#160;<i>rect</i>, int&#160;<i>logicalIndex</i>)</h3><p>Paints the section specified by the given <i>logicalIndex</i>,
using the given <i>painter</i> and <i>rect</i>.</p>
<p>Normally, you do not have to call this function.</p>


<h3 class="fn"><a name="reset" />QHeaderView.reset (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#reset">QAbstractItemView.reset</a>().</p>


<h3 class="fn"><a name="resizeMode" /><a href="qheaderview.html#ResizeMode-enum">ResizeMode</a> QHeaderView.resizeMode (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns the resize mode that applies to the section specified by
the given <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#setResizeMode">setResizeMode</a>().</p>


<h3 class="fn"><a name="resizeSection" />QHeaderView.resizeSection (<i>self</i>, int&#160;<i>logicalIndex</i>, int&#160;<i>size</i>)</h3><p>Resizes the section specified by <i>logicalIndex</i> to
<i>size</i> measured in pixels.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionResized">sectionResized</a>(), <a href="qheaderview.html#resizeMode">resizeMode</a>(), and <a href="qheaderview.html#sectionSize">sectionSize</a>().</p>


<h3 class="fn"><a name="resizeSections" />QHeaderView.resizeSections (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resizeSections()</tt>.</p><p>Resizes the sections according to the given <i>mode</i>,
ignoring the current resize mode.</p>
<p><b>See also</b> <a href="qheaderview.html#resizeMode">resizeMode</a>() and <a href="qheaderview.html#sectionResized">sectionResized</a>().</p>


<h3 class="fn"><a name="resizeSections-2" />QHeaderView.resizeSections (<i>self</i>, <a href="qheaderview.html#ResizeMode-enum">ResizeMode</a>&#160;<i>mode</i>)</h3><p>Resizes the sections according to their size hints. Normally,
you do not have to call this function.</p>


<h3 class="fn"><a name="restoreState" />bool QHeaderView.restoreState (<i>self</i>, <a href="qbytearray.html">QByteArray</a>&#160;<i>state</i>)</h3><p>Restores the <i>state</i> of this header view. This function
returns <tt>true</tt> if the state was restored; otherwise returns
false.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qheaderview.html#saveState">saveState</a>().</p>


<h3 class="fn"><a name="rowsInserted" />QHeaderView.rowsInserted (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>start</i>, int&#160;<i>end</i>)</h3><h3 class="fn"><a name="saveState" /><a href="qbytearray.html">QByteArray</a> QHeaderView.saveState (<i>self</i>)</h3><p>Saves the current state of this header view.</p>
<p>To restore the saved state, pass the return value to <a href="qheaderview.html#restoreState">restoreState</a>().</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qheaderview.html#restoreState">restoreState</a>().</p>


<h3 class="fn"><a name="scrollContentsBy" />QHeaderView.scrollContentsBy (<i>self</i>, int&#160;<i>dx</i>, int&#160;<i>dy</i>)</h3><h3 class="fn"><a name="scrollTo" />QHeaderView.scrollTo (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, <a href="qabstractitemview.html#ScrollHint-enum">QAbstractItemView.ScrollHint</a>&#160;<i>hint</i>)</h3><h3 class="fn"><a name="sectionPosition" />int QHeaderView.sectionPosition (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns the section position of the given <i>logicalIndex</i>,
or -1 if the section is hidden. The position is measured in pixels
from the first visible item's top-left corner to the top-left
corner of the item with <i>logicalIndex</i>. The measurement is
along the x-axis for horizontal headers and along the y-axis for
vertical headers.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionViewportPosition">sectionViewportPosition</a>().</p>


<h3 class="fn"><a name="sectionsAboutToBeRemoved" />QHeaderView.sectionsAboutToBeRemoved (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>logicalFirst</i>, int&#160;<i>logicalLast</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void sectionsAboutToBeRemoved(const QModelIndex&amp;,int,int)</tt>.</p><p>This slot is called when sections are removed from the
<i>parent</i>. <i>logicalFirst</i> and <i>logicalLast</i> signify
where the sections were removed.</p>
<p>If only one section is removed, <i>logicalFirst</i> and
<i>logicalLast</i> will be the same.</p>


<h3 class="fn"><a name="sectionsHidden" />bool QHeaderView.sectionsHidden (<i>self</i>)</h3><p>Returns true if sections in the header has been hidden;
otherwise returns false;</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qheaderview.html#setSectionHidden">setSectionHidden</a>().</p>


<h3 class="fn"><a name="sectionsInserted" />QHeaderView.sectionsInserted (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>logicalFirst</i>, int&#160;<i>logicalLast</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void sectionsInserted(const QModelIndex&amp;,int,int)</tt>.</p><p>This slot is called when sections are inserted into the
<i>parent</i>. <i>logicalFirst</i> and <i>logicalLast</i> indices
signify where the new sections were inserted.</p>
<p>If only one section is inserted, <i>logicalFirst</i> and
<i>logicalLast</i> will be the same.</p>


<h3 class="fn"><a name="sectionSize" />int QHeaderView.sectionSize (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns the width (or height for vertical headers) of the given
<i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#length">length</a>(),
<a href="qheaderview.html#setResizeMode">setResizeMode</a>(), and
<a href="qheaderview.html#defaultSectionSize-prop">defaultSectionSize</a>().</p>


<h3 class="fn"><a name="sectionSizeFromContents" /><a href="qsize.html">QSize</a> QHeaderView.sectionSizeFromContents (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns the size of the contents of the section specified by the
given <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#defaultSectionSize-prop">defaultSectionSize</a>().</p>


<h3 class="fn"><a name="sectionSizeHint" />int QHeaderView.sectionSizeHint (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns a suitable size hint for the section specified by
<i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#sizeHint">sizeHint</a>(), <a href="qheaderview.html#defaultSectionSize-prop">defaultSectionSize</a>(),
<a href="qheaderview.html#minimumSectionSize-prop">minimumSectionSize</a>(),
and <a href="qt.html#ItemDataRole-enum">Qt.SizeHintRole</a>.</p>


<h3 class="fn"><a name="sectionsMoved" />bool QHeaderView.sectionsMoved (<i>self</i>)</h3><p>Returns true if sections in the header has been moved; otherwise
returns false;</p>
<p><b>See also</b> <a href="qheaderview.html#moveSection">moveSection</a>().</p>


<h3 class="fn"><a name="sectionViewportPosition" />int QHeaderView.sectionViewportPosition (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns the section viewport position of the given
<i>logicalIndex</i>.</p>
<p>If the section is hidden, the return value is undefined.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionPosition">sectionPosition</a>() and
<a href="qheaderview.html#isSectionHidden">isSectionHidden</a>().</p>


<h3 class="fn"><a name="setCascadingSectionResizes" />QHeaderView.setCascadingSectionResizes (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setClickable" />QHeaderView.setClickable (<i>self</i>, bool&#160;<i>clickable</i>)</h3><p>If <i>clickable</i> is true, the header will respond to single
clicks.</p>
<p><b>See also</b> <a href="qheaderview.html#isClickable">isClickable</a>(), <a href="qheaderview.html#sectionClicked">sectionClicked</a>(), <a href="qheaderview.html#sectionPressed">sectionPressed</a>(), and
<a href="qheaderview.html#showSortIndicator-prop">setSortIndicatorShown</a>().</p>


<h3 class="fn"><a name="setDefaultAlignment" />QHeaderView.setDefaultAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>&#160;<i>alignment</i>)</h3><h3 class="fn"><a name="setDefaultSectionSize" />QHeaderView.setDefaultSectionSize (<i>self</i>, int&#160;<i>size</i>)</h3><h3 class="fn"><a name="setHighlightSections" />QHeaderView.setHighlightSections (<i>self</i>, bool&#160;<i>highlight</i>)</h3><h3 class="fn"><a name="setMinimumSectionSize" />QHeaderView.setMinimumSectionSize (<i>self</i>, int&#160;<i>size</i>)</h3><h3 class="fn"><a name="setModel" />QHeaderView.setModel (<i>self</i>, <a href="qabstractitemmodel.html">QAbstractItemModel</a>&#160;<i>model</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#setModel">QAbstractItemView.setModel</a>().</p>


<h3 class="fn"><a name="setMovable" />QHeaderView.setMovable (<i>self</i>, bool&#160;<i>movable</i>)</h3><p>If <i>movable</i> is true, the header may be moved by the user;
otherwise it is fixed in place.</p>
<p><b>See also</b> <a href="qheaderview.html#isMovable">isMovable</a>() and <a href="qheaderview.html#sectionMoved">sectionMoved</a>().</p>


<h3 class="fn"><a name="setOffset" />QHeaderView.setOffset (<i>self</i>, int&#160;<i>offset</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setOffset(int)</tt>.</p><p>Sets the header's offset to <i>offset</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#offset">offset</a>()
and <a href="qheaderview.html#length">length</a>().</p>


<h3 class="fn"><a name="setOffsetToLastSection" />QHeaderView.setOffsetToLastSection (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setOffsetToLastSection()</tt>.</p><p>Sets the offset to make the last section visible.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qheaderview.html#setOffset">setOffset</a>(), <a href="qheaderview.html#sectionPosition">sectionPosition</a>(), and
<a href="qheaderview.html#setOffsetToSectionPosition">setOffsetToSectionPosition</a>().</p>


<h3 class="fn"><a name="setOffsetToSectionPosition" />QHeaderView.setOffsetToSectionPosition (<i>self</i>, int&#160;<i>visualIndex</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setOffsetToSectionPosition(int)</tt>.</p><p>Sets the offset to the start of the section at the given
<i>visualIndex</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qheaderview.html#setOffset">setOffset</a>() and <a href="qheaderview.html#sectionPosition">sectionPosition</a>().</p>


<h3 class="fn"><a name="setResizeMode" />QHeaderView.setResizeMode (<i>self</i>, <a href="qheaderview.html#ResizeMode-enum">ResizeMode</a>&#160;<i>mode</i>)</h3><p>Sets the constraints on how the header can be resized to those
described by the given <i>mode</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#resizeMode">resizeMode</a>(), <a href="qheaderview.html#length">length</a>(), <a href="qheaderview.html#sectionResized">sectionResized</a>(), and
<a href="qheaderview.html#sectionAutoResize">sectionAutoResize</a>().</p>


<h3 class="fn"><a name="setResizeMode-2" />QHeaderView.setResizeMode (<i>self</i>, int&#160;<i>logicalIndex</i>, <a href="qheaderview.html#ResizeMode-enum">ResizeMode</a>&#160;<i>mode</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the constraints on how the section specified by
<i>logicalIndex</i> in the header can be resized to those described
by the given <i>mode</i>. The logical index should exist at the
time this function is called.</p>
<p><b>Note:</b> This setting will be ignored for the last section
if the <a href="qheaderview.html#stretchLastSection-prop">stretchLastSection</a>
property is set to true. This is the default for the horizontal
headers provided by <a href="qtreeview.html">QTreeView</a>.</p>
<p><b>See also</b> <a href="qheaderview.html#stretchLastSection-prop">setStretchLastSection</a>().</p>


<h3 class="fn"><a name="setSectionHidden" />QHeaderView.setSectionHidden (<i>self</i>, int&#160;<i>logicalIndex</i>, bool&#160;<i>hide</i>)</h3><p>If <i>hide</i> is true the section specified by
<i>logicalIndex</i> is hidden; otherwise the section is shown.</p>
<p><b>See also</b> <a href="qheaderview.html#isSectionHidden">isSectionHidden</a>() and
<a href="qheaderview.html#hiddenSectionCount">hiddenSectionCount</a>().</p>


<h3 class="fn"><a name="setSelection" />QHeaderView.setSelection (<i>self</i>, <a href="qrect.html">QRect</a>, <a href="qitemselectionmodel-selectionflags.html">QItemSelectionModel.SelectionFlags</a>)</h3><p>Reimplemented from <a href="qabstractitemview.html#setSelection">QAbstractItemView.setSelection</a>().</p>
<p>Selects the items in the given <i>rect</i> according to the
specified <i>flags</i>.</p>
<p>The base class implementation does nothing.</p>


<h3 class="fn"><a name="setSortIndicator" />QHeaderView.setSortIndicator (<i>self</i>, int&#160;<i>logicalIndex</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>&#160;<i>order</i>)</h3><p>Sets the sort indicator for the section specified by the given
<i>logicalIndex</i> in the direction specified by <i>order</i>, and
removes the sort indicator from any other section that was showing
it.</p>
<p><i>logicalIndex</i> may be -1, in which case no sort indicator
will be shown and the model will return to its natural, unsorted
order. Note that not all models support this and may even crash in
this case.</p>
<p><b>See also</b> <a href="qheaderview.html#sortIndicatorSection">sortIndicatorSection</a>()
and <a href="qheaderview.html#sortIndicatorOrder">sortIndicatorOrder</a>().</p>


<h3 class="fn"><a name="setSortIndicatorShown" />QHeaderView.setSortIndicatorShown (<i>self</i>, bool&#160;<i>show</i>)</h3><h3 class="fn"><a name="setStretchLastSection" />QHeaderView.setStretchLastSection (<i>self</i>, bool&#160;<i>stretch</i>)</h3><h3 class="fn"><a name="showSection" />QHeaderView.showSection (<i>self</i>, int&#160;<i>alogicalIndex</i>)</h3><p>Shows the section specified by <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#hideSection">hideSection</a>(), <a href="qheaderview.html#isSectionHidden">isSectionHidden</a>(), <a href="qheaderview.html#hiddenSectionCount">hiddenSectionCount</a>(), and
<a href="qheaderview.html#setSectionHidden">setSectionHidden</a>().</p>


<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QHeaderView.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>
<p>Returns a suitable size hint for this header.</p>
<p><b>See also</b> <a href="qheaderview.html#sectionSizeHint">sectionSizeHint</a>().</p>


<h3 class="fn"><a name="sortIndicatorOrder" /><a href="qt.html#SortOrder-enum">Qt.SortOrder</a> QHeaderView.sortIndicatorOrder (<i>self</i>)</h3><p>Returns the order for the sort indicator. If no section has a
sort indicator the return value of this function is undefined.</p>
<p><b>See also</b> <a href="qheaderview.html#setSortIndicator">setSortIndicator</a>() and
<a href="qheaderview.html#sortIndicatorSection">sortIndicatorSection</a>().</p>


<h3 class="fn"><a name="sortIndicatorSection" />int QHeaderView.sortIndicatorSection (<i>self</i>)</h3><p>Returns the logical index of the section that has a sort
indicator. By default this is section 0.</p>
<p><b>See also</b> <a href="qheaderview.html#setSortIndicator">setSortIndicator</a>(),
<a href="qheaderview.html#sortIndicatorOrder">sortIndicatorOrder</a>(),
and <a href="qheaderview.html#showSortIndicator-prop">setSortIndicatorShown</a>().</p>


<h3 class="fn"><a name="stretchLastSection" />bool QHeaderView.stretchLastSection (<i>self</i>)</h3><h3 class="fn"><a name="stretchSectionCount" />int QHeaderView.stretchSectionCount (<i>self</i>)</h3><p>Returns the number of sections that are set to resize mode
stretch. In views, this can be used to see if the headerview needs
to resize the sections when the view's geometry changes.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qheaderview.html#stretchLastSection-prop">stretchLastSection</a>
and <a href="qheaderview.html#resizeMode">resizeMode</a>().</p>


<h3 class="fn"><a name="swapSections" />QHeaderView.swapSections (<i>self</i>, int&#160;<i>first</i>, int&#160;<i>second</i>)</h3><p>Swaps the section at visual index <i>first</i> with the section
at visual index <i>second</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qheaderview.html#moveSection">moveSection</a>().</p>


<h3 class="fn"><a name="updateGeometries" />QHeaderView.updateGeometries (<i>self</i>)</h3><h3 class="fn"><a name="updateSection" />QHeaderView.updateSection (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void updateSection(int)</tt>.</p><h3 class="fn"><a name="verticalOffset" />int QHeaderView.verticalOffset (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemview.html#verticalOffset">QAbstractItemView.verticalOffset</a>().</p>
<p>Returns the vertical offset of the header. This is 0 for
horizontal headers.</p>
<p><b>See also</b> <a href="qheaderview.html#offset">offset</a>().</p>


<h3 class="fn"><a name="viewportEvent" />bool QHeaderView.viewportEvent (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qabstractscrollarea.html#viewportEvent">QAbstractScrollArea.viewportEvent</a>().</p>


<h3 class="fn"><a name="visualIndex" />int QHeaderView.visualIndex (<i>self</i>, int&#160;<i>logicalIndex</i>)</h3><p>Returns the visual index position of the section specified by
the given <i>logicalIndex</i>, or -1 otherwise.</p>
<p>Hidden sections still have valid visual indexes.</p>
<p><b>See also</b> <a href="qheaderview.html#logicalIndex">logicalIndex</a>().</p>


<h3 class="fn"><a name="visualIndexAt" />int QHeaderView.visualIndexAt (<i>self</i>, int&#160;<i>position</i>)</h3><p>Returns the visual index of the section that covers the given
<i>position</i> in the viewport.</p>
<p><b>See also</b> <a href="qheaderview.html#logicalIndexAt">logicalIndexAt</a>().</p>
<h3 class="fn"><a name="visualRect" /><a href="qrect.html">QRect</a> QHeaderView.visualRect (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><h3 class="fn"><a name="visualRegionForSelection" /><a href="qregion.html">QRegion</a> QHeaderView.visualRegionForSelection (<i>self</i>, <a href="qitemselection.html">QItemSelection</a>&#160;<i>selection</i>)</h3><h3 class="fn"><a name="__len__" /> QHeaderView.__len__ (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="geometriesChanged" />void geometriesChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the header's geometries have
changed.</p>
<p>This function was introduced in Qt 4.2.</p>


<h3 class="fn"><a name="sectionAutoResize" />void sectionAutoResize (int,QHeaderView::ResizeMode)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is automatically resized.
The section's logical index is specified by <i>logicalIndex</i>,
and the resize mode by <i>mode</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#setResizeMode">setResizeMode</a>() and <a href="qheaderview.html#stretchLastSection-prop">stretchLastSection</a>().</p>


<h3 class="fn"><a name="sectionClicked" />void sectionClicked (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is clicked. The section's
logical index is specified by <i>logicalIndex</i>.</p>
<p>Note that the sectionPressed signal will also be emitted.</p>
<p><b>See also</b> <a href="qheaderview.html#setClickable">setClickable</a>() and <a href="qheaderview.html#sectionPressed">sectionPressed</a>().</p>


<h3 class="fn"><a name="sectionCountChanged" />void sectionCountChanged (int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the number of sections changes,
i.e., when sections are added or deleted. The original count is
specified by <i>oldCount</i>, and the new count by
<i>newCount</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#count">count</a>(),
<a href="qheaderview.html#length">length</a>(), and <a href="qheaderview.html#headerDataChanged">headerDataChanged</a>().</p>


<h3 class="fn"><a name="sectionDoubleClicked" />void sectionDoubleClicked (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is double-clicked. The
section's logical index is specified by <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#setClickable">setClickable</a>().</p>


<h3 class="fn"><a name="sectionEntered" />void sectionEntered (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the cursor moves over the section
and the left mouse button is pressed. The section's logical index
is specified by <i>logicalIndex</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qheaderview.html#setClickable">setClickable</a>() and <a href="qheaderview.html#sectionPressed">sectionPressed</a>().</p>


<h3 class="fn"><a name="sectionHandleDoubleClicked" />void sectionHandleDoubleClicked (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is double-clicked. The
section's logical index is specified by <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#setClickable">setClickable</a>().</p>


<h3 class="fn"><a name="sectionMoved" />void sectionMoved (int,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is moved. The section's
logical index is specified by <i>logicalIndex</i>, the old index by
<i>oldVisualIndex</i>, and the new index position by
<i>newVisualIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#moveSection">moveSection</a>().</p>


<h3 class="fn"><a name="sectionPressed" />void sectionPressed (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is pressed. The section's
logical index is specified by <i>logicalIndex</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#setClickable">setClickable</a>().</p>


<h3 class="fn"><a name="sectionResized" />void sectionResized (int,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a section is resized. The section's
logical number is specified by <i>logicalIndex</i>, the old size by
<i>oldSize</i>, and the new size by <i>newSize</i>.</p>
<p><b>See also</b> <a href="qheaderview.html#resizeSection">resizeSection</a>().</p>


<h3 class="fn"><a name="sortIndicatorChanged" />void sortIndicatorChanged (int,Qt::SortOrder)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the section containing the sort
indicator or the order indicated is changed. The section's logical
index is specified by <i>logicalIndex</i> and the sort order is
specified by <i>order</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qheaderview.html#setSortIndicator">setSortIndicator</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>